import random

# 剪刀石头布
# 三局两胜
def rock_paper_scissors():
    player_score = computer_score = 0
    for i in range(3):
        player = input('请输入【剪刀】、【石头】、【布】：')
        computer = random.choice(['剪刀', '石头', '布'])
        print('电脑输入的是 %s' %computer)
        if player == computer:
            player_score += 1
            computer_score += 1
        elif (player == '剪刀' and computer == '布') or (player == '石头' and computer == '剪刀') or (player == '布' and computer == '石头'):
            player_score += 1
        else:
            computer_score += 1
        print('电脑得 %d 分，玩家得 %d 分' %(computer_score, player_score))

    if player_score == computer_score:
        print('平局')
    elif player_score > computer_score:
        print('玩家胜')
    elif player_score < computer_score:
        print('电脑胜')


# 猜大小
def guess_size(start, end):
    number = random.randint(start, end)
    while True:
        player = int(input('请输入你猜的数字：'))
        if player == number:
            print('猜中了！')
            break
        elif player < number:
            print('猜小了')
        elif player > number:
            print('猜大了')
